package com.gr3g.dev.image;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/** Hello world! */
public final class App {

    public static void main(final String[] args)
            throws IOException {
        final File dir = new File("modeles");
        for (final File file : dir.listFiles()) {
            if (file.isDirectory()) {
                System.out.println(file.getPath());
                final FileWriter writer = new FileWriter(file.getPath()
                        + ".json");
                writer.append("{'modele':[\n");
                writer.append(ImageAnalyzer.parse(new File(file.getPath()
                        + "/1.png")));
                writer.append(",\n");
                writer.append(ImageAnalyzer.parse(new File(file.getPath()
                        + "/2.png")));
                writer.append(",\n");
                writer.append(ImageAnalyzer.parse(new File(file.getPath()
                        + "/3.png")));
                writer.append(",\n");
                writer.append(ImageAnalyzer.parse(new File(file.getPath()
                        + "/4.png")));
                writer.append(",\n");
                writer.append(ImageAnalyzer.parse(new File(file.getPath()
                        + "/5.png")));
                writer.append("\n]}");
                writer.close();
            }
        }
    }
}
